<?php if (!defined('THINK_PATH')) exit();?><html>
    <head>
        <title>商品类编辑</title>
        <link href="<?php echo (ADMIN_CSS_URL); ?>bootstrap.css" rel="stylesheet" />
        <link href="<?php echo (ADMIN_CSS_URL); ?>lz-style.css" rel="stylesheet" />
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>jquery.form.js"></script>
        <script src="<?php echo (ADMIN_JS_URL); ?>bootstrap.js"></script>
        <script language="JavaScript">

            $(function () {
                $('#editform').ajaxForm({
                    beforeSubmit: checkForm, // pre-submit callback
                    success: complete, // post-submit callback
                    dataType: 'json'
                });
                function checkForm() {

                    if ('' == $.trim($('#GoodsCategoryId').val())) {
                        $('#success').hide();
                        $('#error').html('[商品分类ID]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#GoodsCategoryName').val())) {
                        $('#success').hide();
                        $('#error').html('[商品分类名称]不能为空').show();
                        return false;
                    }

                    if ('' == $.trim($('#GoodsCategoryDesc').val())) {
                        $('#success').hide();
                        $('#error').html('[商品分类描述]不能为空').show();
                        return false;
                    }

                }
                function complete(data) {
                    if (data.status === 1) {
                        $('#error').hide();
                        $('#success').html(data.info).show();
                    } else {
                        $('#success').hide();
                        $('#error').html(data.info).show();
                    }
                }

            });

        </script>

    </head>
    <body>
        <div class="container">
            <div class="row div_head" >
                <div class=" col-xs-6 col-sm-6 text-primary">
                    当前位置是：商品中心>商品类>商品类设置>商品类编辑
                </div>
                <div class="col-xs-6 col-sm-3"></div>
                <div class="col-xs-6 col-sm-3">
                    <a style="text-decoration: none" href="/ecs/index.php/Admin/GoodsCategory/lst">【返回】</a>
                </div>
            </div>

            <hr />
            <div class="row div_form" >
                <form id="editform" action="/ecs/index.php/Admin/GoodsCategory/edit/GoodsCategoryId/002" method="post">

                    <div class="text-right col-xs-6 col-sm-3 " ><label for="GoodsCategoryId" class="control-label">商品分类ID:</label></div>
                    <div class="col-xs-6 col-sm-3" >
                        <input type="text" id="GoodsCategoryId" name="GoodsCategoryId" class="form-control" placeholder="商品分类ID"  value="<?php echo ($post["goodscategoryid"]); ?>" maxlength=42  required
                               />
                    </div>

                    <div class="text-right col-xs-6 col-sm-3 " ><label for="GoodsCategoryName" class="control-label">商品分类名称:</label></div>
                    <div class="col-xs-6 col-sm-3" >
                        <input type="text" id="GoodsCategoryName" name="GoodsCategoryName" class="form-control" placeholder="商品分类名称"  value="<?php echo ($post["goodscategoryname"]); ?>" maxlength=30  required
                               />
                    </div>

                    <div class="text-right col-xs-6 col-sm-3 " ><label for="GoodsCategoryDesc" class="control-label">商品分类描述:</label></div>
                    <div class="col-xs-6 col-sm-3" >
                        <input type="text" id="GoodsCategoryDesc" name="GoodsCategoryDesc" class="form-control" placeholder="商品分类描述"  value="<?php echo ($post["goodscategorydesc"]); ?>" maxlength=500  required
                               />
                    </div>

                    <div class="col-xs-6 col-sm-3">
                        <input type="submit" id="search"  class="btn btn-default" value="提交">
                    </div>

                </form>
            </div>
            <div id="error" class="row text-danger"></div>
            <div id="success" class="row text-success"></div>

        </div>

    </body>
</html>